package com.ms.demo.demo2;

/**
 * @description: 创建具体同事类
 * @author: ms
 * @create: 2022-10-28 11:05
 */
public class ConcreteColleagueA extends Colleague {

    public ConcreteColleagueA(Mediator mediator) {
        super(mediator);
        this.mediator.setColleageA(this);
    }

    /**
     * 自有方法
     */
    public void selfMethodA() {
        System.out.println( this.getClass().getSimpleName()+ "收到中介协作通知，selfMethodA自有方法执行");
    }

    /**
     * 依赖方法
     */
    public void depMethodA() {
        System.out.println( this.getClass().getSimpleName()+ " depMethodA通知中介者进行转发协作");
        // 中介者进行转发协作
        this.mediator.transferA();
    }

}